 <template>
  <!-- 行内表单 -->
  <div class="Form" slot="body">
    <el-form :inline="true" :model="formInline" class="demo-form-inline">
      <el-form-item label="任务名称">
        <el-input v-model="formInline.taskName" placeholder="任务名称"></el-input>
      </el-form-item>
      <el-form-item label="金额">
        <el-input-number v-model="formInline.money" placeholder="金额"></el-input-number>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="onSubmit">添加</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>
      
<script>
export default {
  props: ["queue"],
  data() {
    return {
      formInline: {
        taskName: "",
        money: ""
      },
      taskQueue: this.queue
    };
  },
  methods: {
    onSubmit() {
      console.log("submit!");
      console.log(this.formInline);
      this.taskQueue.push(this.formInline);
      this.$emit("addTask", this.taskQueue);
      this.formInline = {};
    }
  }
};
</script>
      
<style>
</style>